/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sda.levelup.threads;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 *
 * @author user
 */
public class ThreadTest
{

    public static void main(String[] args)
    {
//        BufferedReader buffr = new BufferedReader(new InputStreamReader(System.in));
        Storage storage = new Storage();
        FirstThread a = new FirstThread(storage);
        SecondThread b = new SecondThread(storage);
        Thread ft = new Thread(a);
        Thread st = new Thread(b);
        ft.start();
        st.start();
        Scanner sc = new Scanner(System.in);
        String fromUser;
        do
        {
            System.out.println("Type STOP to stop the programme");
            fromUser = sc.nextLine();
        }
        while (!fromUser.equalsIgnoreCase("stop"));
        a.turnOff();
        b.turnOff();
    }
}
